<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>(点击审核)根据id查工序设计,工序明细审核信息</title>
    <link rel="shortcut icon" href="favicon.ico">
    <link href="/css/bootstrap.min.css?v=3.3.6" rel="stylesheet">
    <link href="/css/font-awesome.min.css?v=4.4.0" rel="stylesheet">
    <link href="/css/animate.css" rel="stylesheet">
    <link href="/css/style.css?v=4.1.0" rel="stylesheet">
    <link href="/bootstraptable/bootstrap-table.css" rel="stylesheet">
    <style>
        .text_bottom_border {
            border: none;
            border-bottom: 1px solid black;
        }

        .text_no_border {
            border: none;
        }
    </style>
</head>
<h5 style="color: #3e79b6">您正在做的业务是：生产管理--产品生产工序设计--产品生产工序设计单审核</h5>
<div class="container">
    <form id="manufacture_process_audit_form" class="form-horizontal">
        <div style="text-align: right">
            <label class="radio-inline">
                <input type="radio" name="checkTag" value="S001-2">未通过
            </label>
            <label class="radio-inline">
                <input type="radio" name="checkTag" value="S001-1">通过
            </label>
            <button type="button" id="sure_btn" class="btn btn-default">确认</button>
            <button type="button" class="btn btn-default" onclick="history.back(-1);">返回</button>
        </div>
        <div class="panel panel-default" style="margin-top: 5px;">

            <input type="hidden" name="id" id="id">
            <div class="page-heading">
                <h2 style="text-align: center; margin-top: 30px;">生产工序设计单</h2>
            </div>
            <div class="panel-body">
                <div class="form-group">
                    <div class="col-sm-6">
                        <label class="col-sm-4 control-label">设计单编号：</label>
                        <div class="col-sm-8">
                            <input type="text" name="designId" id="designId"
                                   class="form-control text_no_border"
                                   style="background-color: white"
                                   readonly>
                        </div>
                    </div>
                    <div class="col-sm-6">
                        <label class="col-sm-4 control-label">设计人：</label>
                        <div class="col-sm-8">
                            <input type="text" name="designer" id="designer"
                                   class="form-control text_bottom_border"
                            />
                        </div>
                    </div>
                </div>
                <div class="form-group">
                    <div class="col-sm-6">
                        <label class="col-sm-4 control-label">产品名称：</label>
                        <div class="col-sm-8">
                            <input type="text" name="productName" id="productName"
                                   class="form-control text_no_border"
                                   style="background-color: white"
                                   readonly
                            >
                        </div>
                    </div>
                </div>
                <div class="form-group">
                    <div class="col-sm-6">
                        <label class="col-sm-4 control-label">产品编号：</label>
                        <div class="col-sm-8">
                            <input type="text" name="productId" id="productId"
                                   class="form-control text_no_border"
                                   style="background-color: white"
                                   readonly
                            >
                        </div>
                    </div>
                </div>
                <!--工序明细表格-->
                <table class="table table-bordered table-striped" data-toggle="table" id="manufacture_audit_details_table">
                    <thead>
                    <tr>
                        <th data-field="detailsNumber">序号</th>
                        <th data-field="procedureName">工序名称</th>
                        <th data-field="procedureId">工序编号</th>
                        <th data-field="procedureDescribe">描述</th>
                        <th data-field="labourHourAmount">工时数</th>
                        <th data-field="amountUnit">单位</th>
                        <th data-field="costPrice">单位工时成本</th>
                        <th data-field="subtotal">工时成本小计（元）</th>
                    </tr>
                    </thead>
                </table>

                <div class="form-group" style="margin-top: 20px;">
                    <div class="col-sm-8">
                        <label class="col-sm-3 control-label">工时总成本：</label>
                        <div class="col-sm-8">
                            <input type="text" name="costPriceSum" id="costPriceSum"
                                   class="form-control text_no_border"
                                   style="background-color: white"
                                   readonly
                            >
                        </div>
                    </div>
                </div>
                <div class="form-group">
                    <div class="col-sm-6">
                        <label class="col-sm-4 control-label">审核人：</label>
                        <div class="col-sm-8">
                            <input type="text" name="checker" id="checker"
                                   class="form-control text_bottom_border"
                            >
                        </div>
                    </div>
                    <div class="col-sm-6">
                        <label class="col-sm-4 control-label">审核时间：</label>
                        <div class="col-sm-8">
                            <input type="text" name="checkTime" id="checkTime"
                                   class="form-control text_bottom_border"
                                   style="background-color: white"
                                   readonly
                            />
                        </div>
                    </div>
                </div>
                <div class="form-group">
                    <div class="col-sm-12">
                        <label class="col-sm-2 control-label">设计要求：</label>
                        <div class="col-sm-8">
                            <textarea rows="3" cols="100" class="form-control"
                                      style="resize: none;overflow-y: scroll" name="procedureDescribe"
                                      id="procedureDescribe"></textarea>
                        </div>
                    </div>
                </div>
            </div>
        </div>
    </form>
</div>



<!-- 全局js -->
<script src="/js/jquery.min.js?v=2.1.4"></script>
<script src="/js/bootstrap.min.js?v=3.3.6"></script>
<script src="/js/plugins/metisMenu/jquery.metisMenu.js"></script>
<script src="/js/plugins/slimscroll/jquery.slimscroll.min.js"></script>
<script src="/js/plugins/layer/layer.min.js"></script>

<!-- 自定义js -->
<script src="/js/hAdmin.js?v=4.1.0"></script>
<script src="/js/currentTime.js"></script>

<!-- 第三方插件 -->
<script src="/js/plugins/pace/pace.min.js"></script>

<!--BootstrapTable-->
<script src="/bootstraptable/bootstrap-table.min.js"></script>
<script src="/bootstraptable/locale/bootstrap-table-zh-CN.min.js"></script>

<script>
    $(function (){
        //获取设计单id
        let id=localStorage.getItem("id")

        //设计审核时间
        $("#manufacture_process_audit_form #checkTime").val(add(fortime()))

        //根据工序设计单id查询工序信息
        $.post("/manufacture/process/getIdProcess",{"id":id},function (res){
            $("#manufacture_process_audit_form #id").val(res.id)
            $("#manufacture_process_audit_form #designId").val(res.designId)
            $("#manufacture_process_audit_form #designer").val(res.designer)
            $("#manufacture_process_audit_form #productName").val(res.productName)
            $("#manufacture_process_audit_form #productId").val(res.productId)
            $("#manufacture_process_audit_form #costPriceSum").val(res.costPriceSum)
            $("#manufacture_process_audit_form #procedureDescribe").val(res.procedureDescribe)
        })

        //根据工序设计单id查询工序明细
        $.post("/manufacture/process/getByIdProcessDetails",{"id":id},function (res){
            for(let i=0;i<res.length;i++){
                $("#manufacture_audit_details_table").bootstrapTable("append",res[i])
            }
        })

        //点击确定按钮
        $("#manufacture_process_audit_form #sure_btn").click(function (){
            let radio_val = $(":radio[name='checkTag']:checked").val()
            if (radio_val == null) {
                alert("请选中审核状态")
                return
            }
            let parms=$("#manufacture_process_audit_form").serialize()
            $.post("/manufacture/process/updateProcessAudit",parms,function (res){
                if (res){
                    window.location="manufacture_process_design_listUI"
                }
            })
        })
    })
</script>
</body>
</html>